﻿<%@ Page Title="Alquilar" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="alquilarVehiculo.aspx.cs" Inherits="ProyectoFinal.Alquileres.alquilarVehiculo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
     <h2>Alquiler</h2>
    <div class="tabbable">
        <div class="row-fluid">
        <div class="span6">
            <label>Cliente </label><asp:DropDownList name="dd_Cliente" ID="dd_Cliente" AutoPostBack="true" runat="server" 
                OnSelectedIndexChanged="dd_Cliente_SelectedIndexChanged"></asp:DropDownList>
            <p>Cualquier alquiler esta sujeto a disponibilidad.</p>
        </div>
        <div class="span6">
            <label>Fecha de obtencion </label><asp:TextBox ID="txt_Fecha_Obtencion" runat="server" CssClass="Fecha"></asp:TextBox>
            <label>Fecha de Entrega </label><asp:TextBox ID="txt_Entrega" runat="server" CssClass="Fecha"></asp:TextBox>
            
        </div>
        </div>
        <div class="row-fluid">
            <div class="well">
                <div class="row-fluid">
                    <div class="span4">
                        <br /><br />
               <asp:GridView ID="gvAutos" runat="server" AutoGenerateColumns="False"
                EmptyDataText="No hay autos seleccionados." DataKeyNames="Codigo_Auto"
                OnRowCancelingEdit="gvAutos_RowCancelingEdit" OnRowCommand="gvAutos_RowCommand"
                OnRowDataBound="gvAutos_RowDataBound" OnRowDeleting="gvAutos_RowDeleting"
                OnRowUpdating="gvAutos_RowUpdating" ShowFooter="True" Width="95%" OnRowEditing="gvAutos_RowEditing">
                <Columns>
                    <asp:TemplateField HeaderText="Auto">
                        <EditItemTemplate>
                            <asp:DropDownList ID="dd_Auto_Edit" runat="server" ValidationGroup="B">
                            </asp:DropDownList>
                            <%-- '<%# Bind("Auto") %>'--%>
                        </EditItemTemplate>
                        <FooterTemplate>

                            <asp:DropDownList ID="dd_Auto" runat="server" ValidationGroup="B"></asp:DropDownList>

                        </FooterTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Auto") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Cantidad">
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_cantidad_edit" runat="server" Text='<%# Bind("Cantidad") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txt_cantidad" runat="server" ValidationGroup="B" Width="95px">

                            </asp:TextBox>
                        </FooterTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("Cantidad") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Costo Alquiler">
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_total_Auto_edit" runat="server" Text='<%# Bind("Total_Auto") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txt_total_Auto" runat="server" ValidationGroup="B" Width="95px">

                            </asp:TextBox>
                        </FooterTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("Total_Auto") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Poliza Seguro">
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_poliza_edit" runat="server" Text='<%# Bind("Poliza_Seguro") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txt_poliza" ValidationGroup="B" runat="server" Width="95px">

                            </asp:TextBox>
                        </FooterTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("Poliza_Seguro") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Extras">
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_extras_edit" runat="server" Text='<%# Bind("Extras") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txt_extras" ValidationGroup="B" runat="server" Width="95px">

                            </asp:TextBox>
                        </FooterTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("Extras") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="editar" Text="Editar"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" CommandName="eliminar" Text="Eliminar"></asp:LinkButton>
                        </ItemTemplate>
                        <FooterTemplate>

                            <asp:LinkButton ID="lnkAdd" runat="server" Text="Agregar Auto" CommandName="Insert"
                                CausesValidation="True" ValidationGroup="B" ForeColor="Blue" Font-Overline="false"></asp:LinkButton>

                        </FooterTemplate>
                    </asp:TemplateField>

                </Columns>
            </asp:GridView>         


                  
                </div>
            </div>
        <div class="row-fluid">
            <div class="offset7 span5">
                <br /><br /><br /><br />
                <label style="display:inline">Total </label><asp:TextBox ID="txt_total" runat="server"></asp:TextBox>
                <asp:Button ID="btn_guardar" runat="server" Text="Alquilar" class="btn btn-primary btn_guardar_nuevo" OnClick="btn_guardar_Click" style="margin-bottom:10px"/>
            </div>
        </div>
        </div>
    </div>
</asp:Content>
